﻿define(["service/service", "service/httpService"], function (service) {
    service.factory("productService", function (httpService) {
        var methods = {
            gets: function (params) {
                return httpService.get("/admin/product/gets", params);
            },
            get: function (params) {
                return httpService.get("/admin/product/get", params);
            },
            save: function (params) {
                return httpService.upload("/admin/product/save", params);
            },
            delete: function (id) {
                return httpService.delete("/admin/product/delete/" + id);
            },
            disable: function (id) {
                return httpService.post("/admin/product/disable/" + id);
            },
            get_categorys: function (params) {
                return httpService.get("/admin/product/categorys", params);
            },
            get_token_categorys: function () {
                return httpService.get("/admin/product/GetTokenCategorys");
            },
            get_sku_info: function (params) {
                return httpService.get("/admin/product/GetSkuInfo", params);
            },
            audit: function (params) {
                return httpService.post("/admin/product/Audit", params);
            },
            editProductCategory: function (id, categoryId) {
                return httpService.post("/admin/product/EditProductCategory/", { id: id, categoryId: categoryId });
            }
        }
        return methods;
    });
});